package com.icss.orders.vo;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

import com.icss.common.vo.BasePojo;
import com.icss.users.vo.ReCart;
import com.icss.users.vo.ReUsers;

/**
 * ~订单Pojo
 * 
 * @author 刘鑫
 */
public class ReOrders extends BasePojo<ReOrders>
{
	private int id;
	private int usersId;
	private String receName;
	private String recePhone;
	private String receAddress;
	private double totalPrice;
	private double discount ; 
	private double dealAmount;
	private String content;
	private byte status;
	private Date createTime;
	private Date updateTime;
	private Date pubTime;
	private Date payTime;

	/*--字符串表示--*/
	private String statusStr;
	/*--关联对象表示--*/
	private ReUsers users;
	
	private List<ReCart> cartList = new ArrayList<ReCart>();
	
	/* 存储所有状态的容器 */
	private Map<String, String> enumsMap = new TreeMap<String, String>();

	/**
	 * 获取此表相关的所有枚举值
	 * 
	 * @return 键为枚举的变量名+枚举的值; 值为枚举的名字 如:key:STATUS_ENABLE-1,值:启用
	 */
	public Map<String, String> getEnumsMap()
	{
		// 根据状态值获取字符串描述
		ReOrdersEnum[] enums = ReOrdersEnum.values();
		for (int i = 0; i < enums.length; i++)
		{
			ReOrdersEnum enumTemp = enums[i];
			String key = enumTemp.toString();
			enumsMap.put(key + "-" + enumTemp.getStatus() + "", enumTemp.getName());
		}
		return enumsMap;
	}

	/**
	 * 获取状态的字符串描述
	 * 
	 * @return 此状态对应的字符串描述
	 */
	public String getStatusStr()
	{
		// 根据状态值获取字符串描述
		ReOrdersEnum[] enums = ReOrdersEnum.values();
		for (int i = 0; i < enums.length; i++)
		{
			ReOrdersEnum enumTemp = enums[i];
			if (enumTemp.toString().startsWith("STATUS_"))
			{
				// 表示是状态的标识
				if (enumTemp.getStatus() == this.getStatus())
				{
					this.statusStr = enumTemp.getName();
					break;
				}
			}
		}
		return statusStr;
	}

	public int getId()
	{
		return id;
	}

	public void setId(int id)
	{
		this.id = id;
	}

	public int getUsersId()
	{
		return usersId;
	}

	public void setUsersId(int usersId)
	{
		this.usersId = usersId;
	}

	public String getReceName()
	{
		return receName;
	}

	public void setReceName(String receName)
	{
		this.receName = receName;
	}

	public String getRecePhone()
	{
		return recePhone;
	}

	public void setRecePhone(String recePhone)
	{
		this.recePhone = recePhone;
	}

	public String getReceAddress()
	{
		return receAddress;
	}

	public void setReceAddress(String receAddress)
	{
		this.receAddress = receAddress;
	}

	public double getTotalPrice()
	{
		return totalPrice;
	}

	public void setTotalPrice(double totalPrice)
	{
		this.totalPrice = totalPrice;
	}

	public double getDealAmount()
	{
		return dealAmount;
	}

	public void setDealAmount(double dealAmount)
	{
		this.dealAmount = dealAmount;
	}

	public String getContent()
	{
		return content;
	}

	public void setContent(String content)
	{
		this.content = content;
	}

	public byte getStatus()
	{
		return status;
	}

	public void setStatus(byte status)
	{
		this.status = status;
	}

	public Date getCreateTime()
	{
		return createTime;
	}

	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}

	public Date getUpdateTime()
	{
		return updateTime;
	}

	public void setUpdateTime(Date updateTime)
	{
		this.updateTime = updateTime;
	}

	public Date getPubTime()
	{
		return pubTime;
	}

	public void setPubTime(Date pubTime)
	{
		this.pubTime = pubTime;
	}

	public Date getPayTime()
	{
		return payTime;
	}

	public void setPayTime(Date payTime)
	{
		this.payTime = payTime;
	}

	public ReUsers getUsers()
	{
		return users;
	}

	public void setUsers(ReUsers users)
	{
		this.users = users;
	}

	public List<ReCart> getCartList()
	{
		return cartList;
	}

	public void setCartList(List<ReCart> cartList)
	{
		this.cartList = cartList;
	}

	public double getDiscount()
	{
		return discount;
	}

	public void setDiscount(double discount)
	{
		this.discount = discount;
	}
}
